/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package BO;

import java.util.List;
import java.util.Vector;

/**
 *
 * @author olivierm
 */
public class ListeIntervention {

    //*******************************************************************
    //Variables
    //*******************************************************************
    
    private static ListeIntervention instance;
    private int singletonData;
    private Vector<Intervention> _listeIntervention;

    //*******************************************************************
    //Constructeurs
    //******************************************************************* 
    
    private ListeIntervention(){
        this._listeIntervention = new Vector<Intervention>();
    }    
    
 /**
 * Methodes pour le singleton
 */
    public static ListeIntervention getInstance(){
        if(instance == null) {
            instance = new ListeIntervention();
        }
        return instance;
    }
    
    //*******************************************************************
    //Getters et Setters
    //******************************************************************* 
    
    public synchronized List<Intervention> get_listeIntervention() {
        return _listeIntervention;
    }

    public synchronized void set_listeIntervention(Vector<Intervention> _listeIntervention) {
        this._listeIntervention = _listeIntervention;
    }

    public int getSingletonData() {
        return singletonData;
    }

    public void setSingletonData(int singletonData) {
        this.singletonData = singletonData;
    }
    
    //*******************************************************************
    //Méthode d'instance
    //******************************************************************* 

    public boolean ajouterIntervention(Intervention intervention){
        return false;//TO DO
    }
    
    public boolean supprimerIntervention(Intervention intervention){
        return false;//TO DO
    }
    
    public Intervention rechercherIntervention(int numeroIntervention){
        for(int i=0;i<this._listeIntervention.size();i++){
            int numinter = this._listeIntervention.get(i).get_numeros();
            if(numinter==numeroIntervention)return this._listeIntervention.get(i);
        }
        return null;
    }    
    
    //*******************************************************************
    //Méthode de classe
    //*******************************************************************     
    
}
